-
Notifications
You must be signed in to change notification settings - Fork 256
[auth] fix bootstrap_create_accounts for inactive users #15154
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[auth] fix bootstrap_create_accounts for inactive users #15154
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, just one comment/question I had on the new change see updated comment. In that case LGTM! Thanks for the fix.
| 'UPDATE users SET state = "active", last_activated = CURRENT_TIMESTAMP(3) WHERE id = %s;', | ||
| (row['id'],), | ||
| ) | ||
| return None |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just want to confirm, will this reactivate all inactive users rather than just any inactive test users (eg test-dev)? And then follow up if yes, do we think making every inactive user active again mess with anything else downstream of this in ci?
Disregard, I can't read. I see now that we're only doing this for the bot accounts:
hail/ci/bootstrap_create_accounts.py
Lines 76 to 84 in 9458374
| users = [ | |
| # username, login_id, is_developer, is_service_account | |
| ('auth', None, 0, 1), | |
| ('batch', None, 0, 1), | |
| ('ci', None, 0, 1), | |
| ('test', None, 0, 0), | |
| ('test-dev', None, 1, 0), | |
| ('grafana', None, 0, 1), | |
| ] |
...
hail/ci/bootstrap_create_accounts.py
Lines 104 to 105 in 9458374
| for username, login_id, is_developer, is_service_account in users: | |
| user_id = await insert_user_if_not_exists(app, username, login_id, is_developer, is_service_account) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right, but actually bot or non-bot we can read this as "for the accounts that we are bootstrapping into the system, we should reactivate them if they already exist but are inactive". It doesn't do anything to any other preexisting accounts
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good.
Change Description
Fixes our
bootstrap_create_accountsscript to be resilient to inactive users.In this case "create"ing an account that is currently inactive becomes reactivating it.
Security Assessment
Impact Rating
Impact Description
Making a script resilient be replacing a "create" action with a "reactivate" action, if necessary
Appsec Review